<%-- 
    Document   : login_form
    Created on : Mar 14, 2012, 3:39:15 PM
    Author     : Vien-IT
--%>


<!DOCTYPE html>
<html>
   
    <body>
        <%
String username = (String)session.getAttribute("username");
String o = (String)request.getParameter("out");
String errr = (String) request.getParameter("err");
if(o==null) o = "";
else
{
    session.removeAttribute("username");
    response.sendRedirect("index.jsp");
}
if(username != null)
{
    %>
    <div id="login_form_login">
    <h2 style="color: red;">Xin chao : <%=username%></h2>
    <a href="index.jsp?out=true"> Dang Xuat</a>&nbsp;&nbsp;
    <a href="my_cart.jsp">Gio hang cua toi</a>&nbsp;&nbsp;
    <a href="favorite.jsp">San pham uu thich</a>
    </div>
        <%
}
else
{
    %>
        <div id="login_form_login">
        <form action="login" method="post">
            <table>
                <tr>
                    <td style="font-size: 14px;">Ten Dang Nhap : </td>
                    <td ><input type="text" name="username"/></td>
                </tr>
                <tr>
                    <td style="font-size: 14px;">Mat Khau : </td>
                    <td ><input type="text" name="password"/></td>
                </tr>
                <tr>
                    <td>
                        <input type="checkbox" name="rememberLogin" value="rememberLogin"/> Ghi nho <br></td>
                <input type="hidden" name="action" value="login"/>
                         <td><input type="submit" name="login" value="Dang Nhap"/></td>
                    
                </tr>
                <%
                if(errr!=null) 
                                   {
                    %>
                    <tr>
                        <td style="color: red"> Dang nhap that bai</td>
                    </tr>
                    <%}%>
                <%
                %>
                <tr>
                    <td style="margin-left: 10px; font-size: 15px"><a href="register.jsp">Dang ki tai khoan</a></td>
                </tr>
            </table>
            
            
        </form>
    </div>
    <%
}
%>
         
    </body>
</html>
